﻿<%@page import="com.hh.bss.util.StringHelper" %>
<%
  String companyId=request.getParameter("companyId");  
  
  if (StringHelper.isEmpty(companyId)) companyId="0";
  String type=request.getParameter("type"); 
%> 
<!DOCTYPE html>  
<html>  
<head>  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
    <meta name="keywords" content="公司">  
    <meta name="description" content="公司">  
    <title>公司管理</title>  
    
    <%@ include file="/WEB-INF/inc/default.jsp"%>
    <jsp:include page="/WEB-INF/inc/dic.jsp"/>  

</head>  
<body>  
    
      
     
    <!-- edit form窗体（开始） -->  
    <div class="easyui-panel"  style="width:900px"> 
        <form id="fm" method="post" novalidate>  
        	  	  	 <input type="hidden" name="id" > 
        	  	  	 
    	<table cellSpacing=0 cellPadding=0 class="dv-table" style="width:100%;border:0px solid #ccc;padding:5px;margin-top:0px;">
        <tr>
          <td align="right" style="width:100px;" >公司简称<font color="red">*</font>:</td>
          <td><input name="abbrName" class="easyui-box easyui-validatebox"  required="true"></td>
          <td align="right">公司中文名</td>
          <td><input name="name" class="easyui-box"  ></td>
        </tr>  
        <tr>
          <td align="right">公司英文名</td>
          <td><input name="fullName" class="easyui-box"  ></td>
          <td align="right">一级行业<font color="red">*</font>:</td>
          <td><input class="easyui-combobox" name="industry_parent" required="true" style="width:200px;"  data-options="data:__getCategoryByParant('INDUSTRY', 0),valueField:'id', textField:'codeNameCn', multiple:false,panelHeight:'auto',mode:'remote'
		       	,onSelect: function(rec){              
                $('#second_industry').combobox('loadData', __getCategoryByParant('INDUSTRY', rec.id));  
                $('#second_industry').combobox('setValue',null);
             }
			    "></td>
        </tr> 	 
         <tr>
          <td align="right">公司性质<font color="red">*</font>:</td>
          <td><input class="easyui-combobox" name="property" style="width:200px;" required="true"  data-options="data:__getCategory('COMPANY_NATURE'),valueField:'id', textField:'codeNameCn', multiple:false,panelHeight:'auto',mode:'remote' "></td>
          <td align="right">二级行业<font color="red">*</font>:</td>
          <td><input class="easyui-combobox" id="second_industry" required="true"  name="industry" style="width:200px;"  data-options="data:__getCategory('INDUSTRY'),valueField:'id', textField:'codeNameCn', multiple:false,panelHeight:'auto',mode:'remote' "></td>
        </tr>  	  	 
        <tr>
          <td align="right">机构类型<font color="red">*</font>:</td>
          <td><input class="easyui-combobox" name="type" required="true" style="width:200px;"  data-options="data:__getCategory('ORGANIZATION_TYPE'),valueField:'id', textField:'codeNameCn', multiple:false,panelHeight:'auto',mode:'remote' "></td>
          <td align="right">电话总机</td>
          <td><input name="tel" class="easyui-box" required="true"></td>
        </tr>
        <tr>
          <td align="right">网站</td>
          <td><input name="website" class="easyui-box"></td>
          <td align="right">传真</td>
          <td><input name="fax" class="easyui-box"></td>
        </tr>
        <tr>
          <td align="right">地址</td>
          <td><input name="address" class="easyui-box"> </td>
          <td align="right">邮编</td>
          <td><input name="postcode" class="easyui-box"></td>
        </tr>
        
        <tr>
          <td align="right">城市<font color="red">*</font>:</td>
          <td><input class="easyui-combobox" name="location" required="true" style="width:200px;"  data-options="data:__getCategory('LOCATION'),valueField:'id', textField:'codeNameCn', multiple:false,panelHeight:'auto',mode:'remote' "></td>
          <td align="right">公司产品</td>
          <td><input name="product" class="easyui-box"></td>
        </tr>
        <tr>
          <td align="right">行业排名</td>
          <td><input name="productLevel" class="easyui-box"></td>
          <td align="right">注册资本</td>
          <td><input name="regCapital" class="easyui-box"></td>
        </tr>
        <tr>
          <td align="right">人员规模</td>
          <td><input class="easyui-combobox" name="size" style="width:200px;"  data-options="data:__getCategory('COMPANY_SIZE'),valueField:'id', textField:'codeNameCn', multiple:false,panelHeight:'auto',mode:'remote' "></td>
          <td align="right">公司信息完善度</td>
          <td><input class="easyui-combobox" name="integrity" style="width:200px;"  data-options="data:__getConstantCategory('CompanyIntegrity'),valueField:'code', textField:'value', multiple:false,panelHeight:'auto',mode:'remote' "></td>
        </tr>
        
        <tr>
          <td align="right">资本描述</td>
          <td colspan=3><textarea name="capital" style="height:50px;width:90%"></textarea></td>
          
        </tr>
        <tr>
          <td align="right">公司背景</td>
          <td colspan=3><textarea name="background" style="height:50px;width:90%"></textarea></td>
          
        </tr>
        <tr>
          <td align="right">企业文化</td>
          <td colspan=3><textarea name="culture" style="height:50px;width:90%"></textarea></td>
          
        </tr>
        <tr>
          <td align="right">公司介绍<font color="red">*</font>:</td>
          <td colspan=3><textarea name="profile" class="easyui-validatebox" required="true" style="height:50px;width:90%"></textarea></td>
          
        </tr>
        <tr>
          <td align="right">公司介绍（招聘职位使用）</td>
          <td colspan=3><textarea name="jobProfile" style="height:50px;width:90%"></textarea></td>
          
        </tr>
        	  	  	 
	    </table>     		    		     
        </form>  
        <div id="dlg-buttons" style="text-align:center;padding:5px">  
          <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="save()">保存</a>  
          <%if (!"UPDATE".equals(type)){ %>
          <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:closeWin()">关闭</a>  
          <% } %>
        </div> 
    </div>  
    <!-- edit form窗体（结束） -->  
    
     
    
    <script type="text/javascript">  
        
        
        var url='/customer/company/save.do';
        <%if ("UPDATE".equals(type)){ %>
            url='/customer/company/update.do';
        <% }else if ("BD".equals(type)){ %>
        	  url='/customer/customerBd/comapnybdcustomersave.do';
        <% } %>	
        
        function setUrl(oUrl){
           url=oUrl;
        } 
        
         $('#fm').form({
        	    onLoadSuccess: function(data){
        	     
        	    	//处理一二级行业
        	    	        	    	
        	    	var industry=data.industry?data.industry.toString():null;
        	    	var industry_parent = __getCategoryCodeParant('INDUSTRY', industry); // 加载一级行业        	    	
        	    	
        	    	$('#fm input[comboname="industry_parent"]').combobox("setValue",industry_parent);
        	    	
        	    	$('#fm input[comboname="industry"]').combobox('loadData',__getCategoryByParant('INDUSTRY', industry_parent));
        	    	
        	    	
        	    	
        	    }
        });        
        function save(){          	   
        	  if (!$('#fm').form('validate')) return; 
            $('#fm').form('submit',{  
                url: url,  
                onSubmit: function(){  
                    return $(this).form('validate');  
                },  
                success: function(result){  
                    var result = eval('('+result+')');  
                    
                    if (result.success == true){  
                        //$.messager.alert('信息',result.msg,'info');  
                         alert(result.msg);
                        if (refresh) refresh();
                        if (closeWin) closeWin();
                        //$('#dlg').dialog('close');      // close the dialog  
                        //$('#dg').datagrid('reload');    // reload the user data  
                    } else {  
                        $.messager.alert('错误',result.msg,'error');
                    }  
                }  
            });  
        }  
        
    </script>  
     
     

     
     
     
</body>  
</html>

<script>
 <%if ("UPDATE".equals(type)){ %>
   $('#fm').form('load','/customer/company/get.do?id='+<%=companyId%>); 
 <% }  %>
  
</script>